﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我的收藏 - {site.name}</title>
<meta name="keywords" content="{site.seo_keyword}" />
<meta name="description" content="{site.seo_description}" />
<link href="<%templateskin="main"%>/css/style.css" rel="stylesheet" type="text/css" />
 <link href="{config.webpath}css/pagination.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="{config.webpath}scripts/artdialog/ui-dialog.css" />
<script type="text/javascript" charset="utf-8" src="{config.webpath}scripts/jquery/jquery-1.11.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="{config.webpath}scripts/artdialog/dialog-plus-min.js"></script>
<script type="text/javascript" charset="utf-8" src="<%templateskin="main"%>/js/common.js"></script>
 <script type="text/javascript">
  function ExecPostBack(checkValue) {
   if (arguments.length == 1) {
    ExecDelete('{config.webpath}plugins/favorite/ajax.ashx?action=delete', checkValue, '#turl');
   } else {
    var valueArr = '';
    $("input[name='checkId']:checked").each(function (i) {
     valueArr += $(this).val();
     if (i < $("input[name='checkId']:checked").length - 1) {
      valueArr += ","
     }
    });
    ExecDelete('{config.webpath}plugins/favorite/ajax.ashx?action=delete', valueArr, '#turl');
   }
  }
 </script>
</head>

<body>
<%template skin="main" src="_header.html"%>
<div class="section clearfix">
  <div class="line30"></div>

  <div class="info-wrap">
    <!--左侧导航-->
    <%template skin="main" src="_ucenter_nav.html"%>
    <!--/左侧导航-->
    
    <!--右侧内容-->
    <div class="home-box">
      <!--我的收藏-->
      <div class="u-tab-head">
        <p>
          <a class="selected" href="<%linkurl("favorite")%>">我的收藏</a>
        </p>
      </div>
      <div class="u-tab-content">
        <div class="title-div">
          <strong>我的收藏</strong>
        </div>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="mtable">
          <%set DataTable favoriteList=get_user_favorite_list(20, page, "channel_name <>'' and user_id="+userModel.id, out totalcount)%> <!--取得一个DataTable-->
          <%set string pagelist=get_page_link(20, page, totalcount, "favorite", "__id__")%> <!--取得分页页码列表-->
          <%foreach(DataRow dr in favoriteList.Rows)%>
            <tr>
              <td width="20" align="center"><input name="checkId" class="checkall" type="checkbox" value="{dr[id]}" ></td>
              <td><a target="_blank" href="<%linkurl({dr[channel_name]}+"_show",{dr[article_id]})%>">{dr[article_title]}</a></td>
             <td><%write new JMcms.BLL.channel().GetModel({dr[channel_name]}).title%></td>
              <td width="150">{dr[add_time]}</td>
              <td width="35"><a onclick="ExecPostBack('{dr[id]}');" href="javascript:;">删除</a></td>
            </tr>
          <%/foreach%>
          <%if(favoriteList.Rows.Count==0)%>
            <tr><td colspan="5" align="center">您还没有添加任何收藏</td></tr>
          <%/if%>
        </table>
        <div class="page-foot">
          <div class="flickr right">{pagelist}</div><!--放置页码列表-->
          <div class="page-btns">
            <a onclick="checkAll(this);" href="javascript:;">全选</a>
            <span class="pipe">|</span>
            <a onclick="ExecPostBack();" href="javascript:;">删除</a>
          </div>
        </div>
      </div>
      <input id="turl" type="hidden" value="<%linkurl("favorite")%>" /><!--存在跳转的URL值-->
      <!--/我的收藏-->

      
    </div>
    <!--/右侧内容-->
  </div>
</div>

<!--Footer-->
 <%template skin="main" src="_footer.html"%>
<!--/Footer-->
</body>
</html>